package com.ruoyi.system.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PocTestingMapper;
import com.ruoyi.system.domain.PocTesting;
import com.ruoyi.system.service.IPocTestingService;
import com.google.common.collect.Lists;
import com.ruoyi.common.core.text.Convert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 项目POC测试Service业务层处理
 *
 * @author zhaonz
 * @date 2023-06-08
 */
@Service
public class PocTestingServiceImpl extends ServiceImpl<PocTestingMapper,PocTesting> implements IPocTestingService
{
    private static final Logger logger = LoggerFactory.getLogger(PocTestingServiceImpl.class);

    @Autowired
    private PocTestingMapper pocTestingMapper;

    /**
     * 查询项目POC测试列表
     *
     * @param pocTesting 项目POC测试
     * @return 项目POC测试
     */
    @Override
    public List<PocTesting> list(PocTesting pocTesting)
    {
        return this.list(new QueryWrapper<>(pocTesting));
    }

    /**
     * 查询项目POC测试
     *
     * @param testingId 项目POC测试主键
     * @return 项目POC测试
     */
    @Override
    public PocTesting selectPocTestingByTestingId(Long testingId)
    {
        return pocTestingMapper.selectPocTestingByTestingId(testingId);
    }

    /**
     * 查询项目POC测试列表
     *
     * @param pocTesting 项目POC测试
     * @return 项目POC测试
     */
    @Override
    public List<PocTesting> selectPocTestingList(PocTesting pocTesting)
    {
        return pocTestingMapper.selectPocTestingList(pocTesting);
    }

    /**
     * 新增项目POC测试
     *
     * @param pocTesting 项目POC测试
     * @return 结果
     */
    @Override
    public int insertPocTesting(PocTesting pocTesting)
    {
        pocTesting.setCreateTime(DateUtils.getNowDate());
        return pocTestingMapper.insertPocTesting(pocTesting);
    }

    /**
     * 修改项目POC测试
     *
     * @param pocTesting 项目POC测试
     * @return 结果
     */
    @Override
    public int updatePocTesting(PocTesting pocTesting)
    {
        pocTesting.setUpdateTime(DateUtils.getNowDate());
        return pocTestingMapper.updatePocTesting(pocTesting);
    }

    /**
     * 批量删除项目POC测试
     *
     * @param testingIds 需要删除的项目POC测试主键
     * @return 结果
     */
    @Override
    public int removeByIds(String testingIds)
    {
        return this.baseMapper.deleteBatchIds(Lists.newArrayList(Convert.toStrArray(testingIds)));
    }

    /**
     * 批量删除项目POC测试
     *
     * @param testingIds 需要删除的项目POC测试主键
     * @return 结果
     */
    @Override
    public int deletePocTestingByTestingIds(String testingIds)
    {
        return pocTestingMapper.deletePocTestingByTestingIds(Convert.toStrArray(testingIds));
    }

    /**
     * 删除项目POC测试信息
     *
     * @param testingId 项目POC测试主键
     * @return 结果
     */
    @Override
    public int deletePocTestingByTestingId(Long testingId)
    {
        return pocTestingMapper.deletePocTestingByTestingId(testingId);
    }
}
